/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Server.ImplementInterface;

import Interface.IRemoteParameter;
import Server.DTO.Parameter_DTO;
import java.rmi.RemoteException;
import static java.rmi.server.RemoteServer.getClientHost;
import java.rmi.server.ServerNotActiveException;
import java.rmi.server.UnicastRemoteObject;
import java.util.ArrayList;

/**
 *
 * @author 10520_000
 */
public class ParameterObject extends UnicastRemoteObject implements IRemoteParameter{

    public ParameterObject() throws RemoteException{
        super();
    }
    @Override
    public int Insert(Parameter_DTO info) throws RemoteException {
        try {
            System.out.println("Invoke Insert from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return ParameterRepository.Insert(info);
    }

    @Override
    public int Update(Parameter_DTO info) throws RemoteException {
        try {
            System.out.println("Invoke Update from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return ParameterRepository.Update(info);
    }

    @Override
    public int Delete(Parameter_DTO info) throws RemoteException {
        try {
            System.out.println("Invoke Delete from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return ParameterRepository.Delete(info);
    }

    @Override
    public Parameter_DTO FindAll() throws RemoteException {
        try {
            System.out.println("Invoke FindAll from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return ParameterRepository.FindAll();
    }
    
}
